#include"process.h"


typedef void (*te_c)(const char* s,double,double);





void DownLoad(double totle,te_c ty)
{
    srand(time(NULL));

    double sudo=rand()%101;
    int cur=0;
    while(cur<totle)
    {
        sudo=rand()%101;
        ty("下载中：", cur, totle);
        cur+=sudo;
        usleep(1000);
        if(cur>totle)
        {

            
        process2("下载中：", 1, 1);
        break;
        }
    }
printf("\n");


}

int main()
{
   // process1() ;
   printf("下载总量：%d\n",10000);
   DownLoad(10000,process2);
   printf("下载总量：%d\n",222222);
   DownLoad(222222,process2);
   printf("下载总量：%d\n",99);
   DownLoad(99,process2);
   printf("下载总量：%d\n",5555);
   DownLoad(5555,process2);
   printf("下载总量：%d\n",1);
   DownLoad(1,process2);

    return 0;
}
